
using System;

namespace cachier
{


	public class CurrencyHandlerFactory
	{
				
		public static CurrencyHandler ParseCurrency(string name) {
			Currency currency;
			if (Enum.IsDefined(typeof(Currency), name))
				currency = (Currency) Enum.Parse(typeof(Currency), name);
			else 
				return new CurrencyHandler(name, new int[] {1, 5, 10, 20, 50, 100, 200, 500, 1000});
			
			switch (currency) {
				case Currency.USD: return new CurrencyHandler(name, new int[] {1, 5, 10, 20, 50, 100});
				case Currency.EUR: return new CurrencyHandler(name, new int[] {5, 10, 20, 50, 100, 200, 500});
				case Currency.RUR: return new CurrencyHandler(name, new int[] {10, 50, 100, 500, 1000, 5000});
				
				default: return new CurrencyHandler(name, new int[] {1, 5, 10, 20, 50, 100, 200, 500, 1000});
			}
		}
	}
}
